package com.bd08.flink.demo.jing

import org.apache.flink.api.scala.ExecutionEnvironment
import org.apache.flink.streaming.api.scala.createTypeInformation

object ReduceDemo  extends App {

  val benv = ExecutionEnvironment.getExecutionEnvironment
  val ds=benv.fromCollection(List("a","b","c","d","a","c"))
  ds.reduce(_+_).print()
  ds.map((_,1)).groupBy(0).reduce((x,y)=>(x._1,x._2+y._2)).print()


}
